package com.csii.pe.dynamic.workflow;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;



import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import com.csii.common.constants.MChannel;
import com.csii.mcs.core.APPMSG;
import com.csii.mcs.core.util.Util;
import com.csii.pe.common.util.BeanUtils;
import com.csii.pe.dynamic.service.ProcessState;
import com.csii.pe.dynamic.service.RequestContext;
import com.csii.pe.dynamic.taskmodel.AppLock;
import com.csii.pe.dynamic.taskmodel.AppLockManager;
import com.csii.pe.dynamic.taskmodel.AuthConfigInfo;
import com.csii.pe.dynamic.taskmodel.Authable;
import com.csii.pe.dynamic.taskmodel.PartyType;
import com.csii.pe.dynamic.taskmodel.Task;
import com.csii.pe.dynamic.taskmodel.TaskOperatorModel;
import com.csii.pe.dynamic.taskmodel.TaskProcessType;
import com.csii.pe.dynamic.taskmodel.TaskState;
import com.csii.pe.dynamic.taskmodel.TaskSubstep;
import com.csii.pe.dynamic.taskmodel.TaskWorkType;
import com.csii.pe.dynamic.taskmodel.UserAuthLevel;
import com.csii.pe.validation.ValidationRuntimeException;

/**
 * 
 * Class:        MCATaskModel
 * Description:  复核授权任务模型
 * Copyright:    Copyright (c)2010
 * Company:      CSII
 * 
 * @author:      wangjianghui
 * @verion:      1.0
 * Create at:    2017-2-27 下午03:27:01
 * 
 * Modification History:
 * Date          Author               Version            Description
 * ----------------------------------------------------------------------------------------
 * 2010-10-16    wangjianghui               1.0
 */
public class MCATaskModel extends AbstractTaskModel {
	private static final String MCA_TASK_PROCESSED_BY_ANOTHER_USER = "mca.task_processed_by_another_user";
	private static final Log logger=LogFactory.getLog(MCATaskModel.class);
	/**任务锁*/
	private AppLockManager appLockManager;
	
	private AppLock getAppLock(RequestContext requestContext, Object request) {
        AppLock appLock = this.appLockManager.createAppLock(requestContext, request);
        this.appLockManager.checkAppLock(appLock);
        return appLock;
    }
	
	 private void deleteAppLock(AppLock appLock) {
		 this.appLockManager.deleteAppLock(appLock);
	 }
	 
	/**
	 * 工作流审批过程 
	 */
	@SuppressWarnings("unchecked")
	public TaskState processTask(TaskProcessType taskProcessType,final Long taskSeq,
			String remark, Object request,
			RequestContext currentRequestContext,
			RequestContext entryRequestContext) {
		TaskState taskstst = new TaskState();
		taskstst.setTaskSeq(taskSeq);
		taskstst.setMessage("");
//		taskstst.setNextAssignedParty(null);
		taskstst.setProcessState(ProcessState.WCK);
		taskstst.setRemoteProcessFlag(true);
		SHTask task=getTask(taskSeq);
		// 审核任务为空，报错该复核任务不存在
		if(task==null){
			throw new ValidationRuntimeException(APPMSG.TASK_TASK_NOT_EXIST);
		}
		
		int token=Integer.valueOf(currentRequestContext.getRequestToken());
		// 判断当前操作是否已被他人操作
		if(task.getTaskLock()!=token){
			throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_BY_ANOTHER_USER,new Object[]{taskSeq});
		}
		// 任务锁
		AppLock appLock = this.appLockManager.createAppLock(entryRequestContext, request);
		
		// TODO 判断当前登入平台(复核处理暂无确定放入那个平台)
		task.setCheckCifSeq(currentRequestContext.getRequestCifSeq());
		task.setCheckUserSeq(currentRequestContext.getRequestUserSeq());
		task.setCheckState(taskProcessType);
		task.setCheckRemark(remark);
		task.setCheckTime(currentRequestContext.getRequestTimestamp());	

		//拒绝,同意,退回
		/** wangjianghui update start 存在审核人和制单人是同意各人的场景，满足自己制单能够审核自己的单据*/
//		if(task.getEntryUserSeq().equals(currentRequestContext.getRequestUserSeq())){
//			//不能复核授权自己录入的交易
//			throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_BY_SELF);
//		}
		/** wangjianghui update end 存在审核人和制单人是同意各人的场景，满足自己制单能够审核自己的单据*/
		
		if(task.getProcessState()==ProcessState.MD){
			// 当前交易正在被修改
			throw new ValidationRuntimeException(APPMSG.TASK_IS_MODIFYING);
		}
		
		// 查询以前复核过的用户（当前复核级别）
		List<Long> userHistoryList=sqlMap.queryForList("queryUserHistoryList",taskSeq);
		
		// 已经复核过一次不能重复复核
		if(userHistoryList.contains(currentRequestContext.getRequestUserSeq())){
			// 该交易已经复核过一次
			throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_ONCE_AGAIN);
		}
		
		// 查询待复核步骤  state = WT 待复核授权
		List<TaskSubstep> taskSubstepList=sqlMap.queryForList("queryTaskStateList",taskSeq);
		
		// 当前级别已全部复核完不需要再复核
		if(taskSubstepList==null||taskSubstepList.isEmpty()){
			// 已经全部授权完
			throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_STEP_FINISH);
		}
		
		// 查询有权限的用户列表,查询任务状态表 taskstat
		Map<String,Object> param=new HashMap<String, Object>();
		param.put("taskSeq", taskSeq);
		param.put("opType", TaskWorkType.C);
		List<Long> authUsers=sqlMap.queryForList("queryQueueUsers",param);
		
		// 当前级别用户集不包含自己
		if(!authUsers.contains(currentRequestContext.getRequestUserSeq())){
			// 没有复核权限
			throw new ValidationRuntimeException(APPMSG.TASK_USER_BE_FORBIDDEN);
		}
		
		// 取得当前复核级别的一条数据
		TaskSubstep taskSubstep=taskSubstepList.get(0);
		taskSubstep.setOpDate(currentRequestContext.getRequestTimestamp());
		// 当前复核人
		taskSubstep.setUserSeq(currentRequestContext.getRequestUserSeq());
		// 理由（拒绝用）
		taskSubstep.setRemark(remark);
		taskSubstep.setState(taskProcessType);
		// 渠道号
		taskSubstep.setMChannelId(MChannel.valueOf(currentRequestContext.getRequestMChannelId()));
		
		// 复核结果为拒绝
		if(taskProcessType==TaskProcessType.RJ){
			// 任务处理状态 拒绝
			task.setProcessState(ProcessState.RJ);
			// 拒绝处理
			deleteTask(task, taskSubstep);
			
			
			String taskStateRemark = "";
			if(!Util.isNullOrEmpty(task.getCheckRemark())){
				taskStateRemark = task.getCheckRemark();
			}
			if(!Util.isNullOrEmpty(task.getBankRemark())){
				taskStateRemark = task.getBankRemark();
			}
			//审核拒绝要给taskstst一个拒绝的状态，而不能返回空 by liziyue
			taskstst.setProcessState(ProcessState.RJ);
			//审核结束删除任务锁
			this.deleteAppLock(appLock);
			return taskstst;
		}else if(TaskProcessType.AG==taskProcessType){// 复核结果为通过
			// 获取渠道
			MChannel mchannel=MChannel.valueOf(entryRequestContext.getRequestMChannelId());
			// 获取当前授权级别
			int level=taskSubstepList.get(0).getStep();
			
			//检查该用户授权后模型能否走通
			userHistoryList.add(currentRequestContext.getRequestUserSeq());				
			authUsers.remove(currentRequestContext.getRequestUserSeq());
			
			// 每级复核人数，复核模版，每级复核用户查询 根据taskSeq查询
			Map paramMap = new HashMap();
			paramMap.put("TaskSeq", taskSeq);
			
			// 更具taskseq查询模版id
			String AudTempId = (String)this.sqlMap.queryForObject("queryTaskQuery", paramMap);
			paramMap.put("AudTempId", AudTempId);
			Map authSetting = (Map)this.sqlMap.queryForObject("queryShentacauthQuery", paramMap);
			
			// 取得复核设置数据，并校验复核模版
			AuthConfigInfo authConfigInfo = authMessageTask(authSetting); 
			
			// TODO 
			task.setProcessState(ProcessState.WCK);
			if(taskSubstepList.size()==1){
				//该级别最后一个人授权。查询下一级别的配置
				level=authConfigInfo.getNextLevel(level - 1);
				
				// 下一级别配置审核人数小于0
				// 没有下一级别审核
				if(level<0){
					// TODO 落地校验，若通过产品进入代发库，不通过 则进入落地处理中心
					taskstst.setProcessState(ProcessState.SB);
					// 删除任务记录历史信息
					deleteTask(task, taskSubstep);
					
					// 当前级别完成，下一级别依旧有审核配置,进行下一级别设置
					
					//审核结束删除任务锁
					this.deleteAppLock(appLock);
				} else {
					// 具有下一级别复核权限用户列表
					List<Long> users=authConfigInfo.getUsers(level);
					
					task.setCurrentAuthLevel(String.valueOf(level+1));
					agreeTaskToNextStep(task, taskSubstep, users,authConfigInfo,level);	
					return taskstst;
					
				}
				// 当前级别仍需别人审核
			}else{
				agreeTaskInCurrentStep(currentRequestContext,task, taskSubstep);
				return taskstst;
			}
		}
		return taskstst;	
	}
	private void agreeTaskInCurrentStep(final RequestContext currentRequestContext, final SHTask task,
			final TaskSubstep taskSubstep) {
		trsTemplate.execute(new TransactionCallback() {						
			public Object doInTransaction(TransactionStatus arg0) {
				// 更新任务状态
				if(sqlMap.update("updateTask",task)==0){
					throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_BY_ANOTHER_USER);
				}
				// 更新任务步骤状态
				sqlMap.update("updateTaskState",taskSubstep);
				
				// 插入历史表
				sqlMap.insert("addTaskStateJnl",taskSubstep);
				
				// 删除队列中已操作的用户
				Map<String,Object> param1=new HashMap<String, Object>();
				param1.put("taskSeq", task.getTaskSeq());
				param1.put("userSeq", currentRequestContext.getRequestUserSeq());
				param1.put("opType", TaskWorkType.C);
				sqlMap.delete("deleteQueueByUser",param1);
				return null;
			}
		});
	}
	
	private void agreeTaskToNextStep(final SHTask task,
			final TaskSubstep taskSubstep, 
			final List<Long> users,
			final AuthConfigInfo authConfigInfo,
			final int nextLevel) {
		trsTemplate.execute(new TransactionCallback() {
			
			public Object doInTransaction(TransactionStatus arg0) {
				//更新任务状态
				if(sqlMap.update("updateTask",task)==0){
					throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_BY_ANOTHER_USER);
				}
				// 更新任务步骤状态
				sqlMap.update("updateTaskState",taskSubstep);
				
				
				//插入新的任务步骤
				for(int i=0;i<authConfigInfo.getLevelAuthCount(nextLevel);++i){
					//插入任务步骤状态表
					TaskSubstep substep=new TaskSubstep();
					substep.setOpType(TaskWorkType.C);// 任务操作类型复核
					substep.setTaskSeq(task.getTaskSeq());
					// substep.setUserGroup(String.valueOf(nextLevel+1));
					substep.setPartyType(PartyType.G);// 任务操作人员：用户组别
					substep.setStep(nextLevel + 1);// 当前复核级别
					substep.setSubStep(i+1);// 当前复核级别第几次复核
					substep.setState(TaskProcessType.WT);// 待复核授权
					// 接口暂无
					sqlMap.insert("addTaskState",substep);
				}
				//删除队列
				sqlMap.delete("deleteTaskQueue",task.getTaskSeq());
				//插入新队列
				for(Long userSeq:users){
					Map<String,Object> param1=new HashMap<String, Object>();
					param1.put("taskSeq", task.getTaskSeq());
					param1.put("userSeq", userSeq);
					param1.put("opType", TaskWorkType.C);
					sqlMap.insert("addTaskQueue",param1);
				}
				//插入历史表
				sqlMap.insert("addTaskStateJnl",taskSubstep);
				return null;
			}
		});
	}
	

	private void submitTaskWithWaiting(final Task task, final TaskSubstep currentTaskSubstep) {
		trsTemplate.execute(new TransactionCallback() {
			
			public Object doInTransaction(TransactionStatus transactionStatus) {
				//更新任务状态
				if(0==sqlMap.update("updateTask",task)){
					//已经有人复核/授权/审批/退回过了
					throw new ValidationRuntimeException(MCA_TASK_PROCESSED_BY_ANOTHER_USER);
				}
				
				//删除已分配的任务队列
				sqlMap.delete("deleteTaskQueue",task.getTaskSeq());
				
				//删除任务状态表		
				sqlMap.delete("deleteTaskState",task.getTaskSeq());
				
				//插入任务状态日志表
				sqlMap.insert("addTaskStateJnl",currentTaskSubstep);
				return null;
			}
		});
	}

	/**
	 * 复核流程——拒绝处理 -清除任务
	 */
	private void deleteTask(final SHTask task,final TaskSubstep taskSubstep) {
		trsTemplate.execute(new TransactionCallback() {
		
			public Object doInTransaction(TransactionStatus arg0) {						
				deleteTaskInDB(task,taskSubstep);
				return null;
			}
		});
		}
	
	private void deleteTaskInDB(SHTask task, TaskSubstep taskSubstep){
		//更新任务状态,为防止已有用户操作过该任务，必须
		if(sqlMap.update("updateTask",task)==0){
			throw new ValidationRuntimeException(APPMSG.TASK_CHECKED_BY_ANOTHER_USER);
		}
		// taskLock加1
		task.setTaskLock(task.getTaskLock()+1);
		// 插入任务历史表
		sqlMap.insert("insertTaskJnl",task);
		// 删除队列
		sqlMap.delete("deleteTaskQueue",task.getTaskSeq());
		// 删除任务状态
		sqlMap.delete("deleteTaskState",task.getTaskSeq());
		// 删除任务
		sqlMap.delete("deleteTask",task.getTaskSeq());
		// 插入历史表
		sqlMap.insert("addTaskStateJnl",taskSubstep);
		
	}
	
	
	public TaskState submitTask(Long taskSeq,RequestContext currentRequestContext,RequestContext entryRequestContext,Object request){
//		if(entryRequestContext.getRequestProductId().equals("")){
//			//TODO集团上拨下划不落地
//		}
		// 
		Task task=getTask(taskSeq);
		
		if(task!=null){
			//清除任务
			finalClearTask(task);
		}		
		return null;
	}


	private void finalClearTask(final Task task) {
		trsTemplate.execute(new TransactionCallback() {
			
			public Object doInTransaction(TransactionStatus transactionStatus) {
				sqlMap.delete("deleteTaskQueue",task.getTaskSeq());
				sqlMap.delete("deleteTaskState",task.getTaskSeq());
				sqlMap.delete("deleteTask",task.getTaskSeq());
				sqlMap.insert("insertTaskJnl",task);
				return null;
			}
		});
		
	}


	@SuppressWarnings({ "rawtypes", "unchecked" })
	public void notifyState(Long taskSeq, ProcessState processState) {
		Map param=new HashMap();
		param.put("ProcessState", processState);
		param.put("TaskSeq", taskSeq);
		this.sqlMap.update("updateTaskJnlState",param);		
	}

	@Override
	public Object check(Object request, RequestContext requestContext) {
		// 是否包含Authable，BusiSeq和TransId
		if (!(request instanceof Authable)) return null;
		
		// 检查应用锁 
        AppLock appLock = getAppLock(requestContext, request);
        if (appLock != null && appLock.getConfig().isAddLock()) {
        	this.deleteAppLock(appLock);
        }
        
		// 取得业务编号，交易编号
		Authable authable = (Authable)request;
		Map queryMap = new HashMap();
		queryMap.put("MChannelId", requestContext.getRequestMChannelId());
		queryMap.put("CifSeq", requestContext.getRequestCifSeq());
		queryMap.put("BusiSeq", authable.getBusiSeq());
		queryMap.put("TransId", authable.getTransId());
		/** 如果需要审核人不能审核自己的定单就使用这个  wangjianghui update start  */ 
		//queryMap.put("UserSeq", requestContext.getRequestUserSeq());
		/** 如果需要审核人不能审核自己的定单就使用这个  wangjianghui update end  */ 
		// 取得当前审核模版，包含各级别复核人数，复核模版
		Map authSetting = (Map)this.sqlMap.queryForObject("queryShentacauthQuery", queryMap);
		
		
		// 当前没有审核模版
		if (authSetting == null || authSetting.isEmpty()) return null;
		
		AuthConfigInfo authConfigInfo = authMessageTask(authSetting);
		
		return authConfigInfo;
	
	}
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	private AuthConfigInfo authMessageTask(Map authSetting){
		AuthConfigInfo authConfigInfo = new AuthConfigInfo();
		int[] levelCount = new int[6];
		// 当一级复核设置为空的时候给0不为空取得一级复核人数
		levelCount[0] = (Integer)authSetting.get("l1count") == null ? 0 : (Integer)authSetting.get("l1count");
		levelCount[1] = (Integer)authSetting.get("l2count") == null ? 0 : (Integer)authSetting.get("l2count");
		levelCount[2] = (Integer)authSetting.get("l3count") == null ? 0 : (Integer)authSetting.get("l3count");
		levelCount[3] = (Integer)authSetting.get("l4count") == null ? 0 : (Integer)authSetting.get("l4count");
		levelCount[4] = (Integer)authSetting.get("l5count") == null ? 0 : (Integer)authSetting.get("l5count");
		levelCount[5] = (Integer)authSetting.get("l6count") == null ? 0 : (Integer)authSetting.get("l6count");
		
		// 存放各级复核人数
		authConfigInfo.setLevelAuthCount(levelCount);
		
		// 存放复核模版
		authConfigInfo.setAudTempId((String)authSetting.get("audTempId"));
		
		// UserAuthLevel 数据对象，用户对应的复核等级 取得当前模版配置的审核人员
		List<UserAuthLevel> userAuthLevelList = (List<UserAuthLevel>)this.sqlMap.queryForList("queryShentusracauthQuery", authSetting.get("audTempId"));
		/** 如果需要审核人不能审核自己的定单就使用这个  wangjianghui update start  */ 
//		Iterator<UserAuthLevel> it = userAuthLevelList.iterator();
//		while(it.hasNext()){
//			UserAuthLevel entity = it.next();
//			if(entity.getUserSeq().equals(authSetting.get("UserSeq"))){
//				it.remove();
//				break;
//			}
//		}
		/** 如果需要审核人不能审核自己的定单就使用这个  wangjianghui update end  */ 
		// 用户授权为空时，返回
		if (userAuthLevelList == null || userAuthLevelList.isEmpty()) return null;
		
		List[] levelUserAuthList = new List[6];
		// 循环数据对象，取得每个复核等级上的用户
		for (UserAuthLevel userAuthLevel : userAuthLevelList) {
			// userAuthLevel.getLevel() - 1 当前审批级别-1作为levelUserAuthList下标
			List oneLevelUserAuthList = levelUserAuthList[Integer.parseInt(userAuthLevel.getLevel().toString()) - 1];
			if (oneLevelUserAuthList == null) {
				oneLevelUserAuthList = new ArrayList();
				levelUserAuthList[Integer.parseInt(userAuthLevel.getLevel().toString()) - 1] = oneLevelUserAuthList;
			}
			
			oneLevelUserAuthList.add(userAuthLevel);
		}
		
		// 取得每级复核用户
		authConfigInfo.setLevelUserAuthList(levelUserAuthList);
		
		// 校验复核模版
		int preCount = 1;
		for (int i = 0; i < 6; i++) {
			// 
			int currentCount = levelCount[i];
			// 当前一级别复核人数为0，后一级别复核人数不为0时抛出异常
			if (preCount == 0 && currentCount != 0) throw new ValidationRuntimeException("auth.config.setting.error"); 
			preCount = currentCount;
			
			// 取得当前级别下复核用户数
			int currentUserCount = levelUserAuthList[i] == null ? 0 : levelUserAuthList[i].size();
			// 审核模版当前级别复核数大于当前级别下复核用户数时报错
			if (currentUserCount < currentCount) {
				throw new ValidationRuntimeException("user.count.too.less"); 
			}
		}
		return authConfigInfo;
	}
	
	
	

	/**
	 * 审核流程设置 
	 */
	@Override
	public TaskState initTask(Object request, RequestContext requestContext, Object authConfigInfo) {
		// 取得check获取的的各项数据
		AuthConfigInfo authConfigInfoEntity = (AuthConfigInfo)authConfigInfo;
		
		// 创建应用锁 
		final AppLock appLock = this.appLockManager.createAppLock(requestContext, request);
			
		// task任务列表插入
		// taskstat任务状态表插入
		TaskState taskstst = new TaskState();
		
		// 取得主键
		Long TaskSeq = requestContext.getRequestJnlNo();
		//工作流主键
		taskstst.setTaskSeq(TaskSeq);
		// TODO 未知
		taskstst.setMessage("");
//		taskstst.setNextAssignedParty(null);
		taskstst.setProcessState(ProcessState.WCK);
		taskstst.setRemoteProcessFlag(true);
		//初始化任务 判断request时候有渠道号
		Long batchNo = null;
		Map data = BeanUtils.bean2Map(request);
		if( null != data.get("_BatchJnlNo"))
			batchNo = Long.parseLong((String)data.get("_BatchJnlNo"));
		
		// 取得task数据
		final Task task = createTask(requestContext,request, ProcessState.WCK, authConfigInfoEntity);
		
		//下一步授权用户列表
		int nextLevel=authConfigInfoEntity.getNextLevel(-1);
		
		// 取得当前审核级别包含用户列表数据
		final List<Long> users=authConfigInfoEntity.getUsers(nextLevel);
		
		// 插入工作流下一级别复核等级，几次复核 
		final List<TaskSubstep> taskSubstepList = new ArrayList<TaskSubstep>();
		for(int i=0;i<authConfigInfoEntity.getLevelAuthCount(nextLevel);++i){
			//插入任务步骤状态表
			TaskSubstep substep=new TaskSubstep();
			substep.setTaskSeq(task.getTaskSeq());
			// substep.setUserGroup(String.valueOf(nextLevel+1));
			substep.setOpType(TaskWorkType.C);// 任务操作类型复核
			substep.setPartyType(PartyType.G);// 任务操作人员：用户组别
			substep.setStep(nextLevel+1);// 当前复核级别
			substep.setSubStep(i+1);// 当前复核级别第几次复核
			substep.setState(TaskProcessType.WT);// 待复核授权
			taskSubstepList.add(substep);
		}
		
		// 插入任务队列表，复核人员
		this.trsTemplate.execute(new TransactionCallback() {
			@Override
			public Object doInTransaction(TransactionStatus arg0) {
				sqlMap.insert("insertTask", task);
				
				for (TaskSubstep taskSubstep : taskSubstepList) {
					sqlMap.insert("addTaskState",taskSubstep);
				}
				for(Long userSeq:users){					
					//插入任务队列表
					Map<String,Object> param=new HashMap<String, Object>();
					param.put("taskSeq", task.getTaskSeq());
					param.put("userSeq", userSeq);
					param.put("opType", TaskWorkType.C);
					// TODO 接口暂无
					sqlMap.insert("addTaskQueue",param);
				}
				
				//添加任务锁
				appLockManager.addAppLock(appLock, task.getTaskSeq(), task.getCreateTime());
				return null;
			}
		});
		
		return taskstst;
	}
	
	
	

	@Override
	public int getBatchTaskCount(Long userSeq) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<TaskOperatorModel> getCompleteTaskList(Map paraMap) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<? extends Task> getBatchTaskList(Long requestUserSeq, String type) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void notifyState(Long taskSeq, ProcessState oldProcessState, ProcessState newProcessState) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void enterModify(RequestContext requestcontext, List<Long> tasks) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void enterModify(RequestContext requestcontext, Long taskSeq) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void cancelModify(RequestContext requestcontext, List<Long> tasks) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void modify(RequestContext requestContext, List<Long> tasks) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void modify(RequestContext requestContext, Long taskSeq) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void cancelModify(RequestContext requestcontext, Long taskSeq) {
		// TODO Auto-generated method stub
		
	}
	public void setAppLockManager(AppLockManager appLockManager) {
		this.appLockManager = appLockManager;
	}
	
}
